package com.mochasoft.shangchm.analyzer;

import java.util.Iterator;
import java.util.Set;
import java.util.TreeSet;

public class LinkAnalyzer implements Analyzer {

	public boolean isBad(TreeSet group) {
		int size = linkSize(group);
		if(size==1||size==2){
			System.out.println("连号数: "+size);
			return false;
		}else{
			return true;
		}
	}
	private int linkSize(Set group){
		int size = 0;
		int befor = 33;
		for (Iterator iter = group.iterator(); iter.hasNext();) {
			int now = (Integer)iter.next();
			if(now - befor==1){
				size++;
			}
			befor = now;
		}
		return size;
	}

}
